package Homework01;
//6.ArrayList去重
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

public class work06 {
    public static void main(String[] args) {
        ArrayList<String> list=new ArrayList();
        Collections.addAll(list, "2","2","3","4","5","5");
        System.out.println(list);

        List<String> newList=list.stream().distinct().collect(Collectors.toList());
        list.clear();
        list.addAll(newList);
        System.out.println("去重结果:"+list);
    }
}
